package com.atqh.logistics.controller.Custom;

import com.atqh.logistics.Aop.LogAnnotation;
import com.atqh.logistics.service.CustomService;
import com.atqh.logistics.service.RequestsService;
import com.atqh.logistics.utils.Result;
import com.atqh.logistics.utils.Vo.params.MissionParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @作者：大叔azhe
 * @api：详细描述
 * @创建时间：21:08 2023/4/12
 */
@Api(tags = "客户模块功能")
@RestController
@CrossOrigin
@RequestMapping("/custom")
public class CustomController {

    @Autowired
    private CustomService customService;

    @ApiOperation("查看个人信息")
    @RequestMapping("/information")
    public Result GetInfo( HttpServletRequest req) {
        return customService.getOwnInfo(req);
    }

    @ApiOperation("发布任务")
    @RequestMapping("/publicmission")
    @LogAnnotation(module = "客户模块", operator = "发布任务")
    public Result PublicMission(@RequestBody MissionParam missionParam, HttpServletRequest req) {
        return customService.PublicMission(missionParam,req);
    }

    @ApiOperation("查看发布的任务（被接受或被拒绝）")
    @RequestMapping("/ViewList")
    @LogAnnotation(module = "客户模块", operator = "查看发布的任务（被接受or被拒绝）")
    public Result ViewPublicMission(HttpServletRequest req) {
        return customService.ViewPublicMission(req);
    }

    @ApiOperation("查看正在进行的任务（完成or进行中）")
    @RequestMapping("/ViewIng")
    @LogAnnotation(module = "客户模块", operator = "查看正在进行的任务")
    public Result ViewNowIngMission(HttpServletRequest req) {
        return customService.ViewNowIngMission(req);
    }
}
